3.11.44 \(\int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx\) [1044]

Optimal. Leaf size=99 \[ \frac {4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac {4 i a^3 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {i a^3 (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)} \]

[Out]

4*I*a^3*(c-I*c*tan(f*x+e))^n/f/n-4*I*a^3*(c-I*c*tan(f*x+e))^(1+n)/c/f/(1+n)+I*a^3*(c-I*c*tan(f*x+e))^(2+n)/c^2
/f/(2+n)

________________________________________________________________________________________

Rubi [A]
time = 0.11, antiderivative size = 99, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {3603, 3568, 45} \begin {gather*} \frac {i a^3 (c-i c \tan (e+f x))^{n+2}}{c^2 f (n+2)}+\frac {4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac {4 i a^3 (c-i c \tan (e+f x))^{n+1}}{c f (n+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + I*a*Tan[e + f*x])^3*(c - I*c*Tan[e + f*x])^n,x]

[Out]

((4*I)*a^3*(c - I*c*Tan[e + f*x])^n)/(f*n) - ((4*I)*a^3*(c - I*c*Tan[e + f*x])^(1 + n))/(c*f*(1 + n)) + (I*a^3
*(c - I*c*Tan[e + f*x])^(2 + n))/(c^2*f*(2 + n))

Rule 45

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rule 3568

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Dist[1/(a^(m - 2)*b
*f), Subst[Int[(a - x)^(m/2 - 1)*(a + x)^(n + m/2 - 1), x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, n}, x
] && EqQ[a^2 + b^2, 0] && IntegerQ[m/2]

Rule 3603

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Di
st[a^m*c^m, Int[Sec[e + f*x]^(2*m)*(c + d*Tan[e + f*x])^(n - m), x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
EqQ[b*c + a*d, 0] && EqQ[a^2 + b^2, 0] && IntegerQ[m] &&  !(IGtQ[n, 0] && (LtQ[m, 0] || GtQ[m, n]))

Rubi steps

\begin {align*} \int (a+i a \tan (e+f x))^3 (c-i c \tan (e+f x))^n \, dx &=\left (a^3 c^3\right ) \int \sec ^6(e+f x) (c-i c \tan (e+f x))^{-3+n} \, dx\\ &=\frac {\left (i a^3\right ) \text {Subst}\left (\int (c-x)^2 (c+x)^{-1+n} \, dx,x,-i c \tan (e+f x)\right )}{c^2 f}\\ &=\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (4 c^2 (c+x)^{-1+n}-4 c (c+x)^n+(c+x)^{1+n}\right ) \, dx,x,-i c \tan (e+f x)\right )}{c^2 f}\\ &=\frac {4 i a^3 (c-i c \tan (e+f x))^n}{f n}-\frac {4 i a^3 (c-i c \tan (e+f x))^{1+n}}{c f (1+n)}+\frac {i a^3 (c-i c \tan (e+f x))^{2+n}}{c^2 f (2+n)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 2.96, size = 110, normalized size = 1.11 \begin {gather*} \frac {i a^3 e^{n (-\log (c \sec (e+f x))+\log (c-i c \tan (e+f x)))} \sec ^2(e+f x) (c \sec (e+f x))^n \left (2 (2+n)+\left (4+3 n+n^2\right ) \cos (2 (e+f x))+i n (3+n) \sin (2 (e+f x))\right )}{f n (1+n) (2+n)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + I*a*Tan[e + f*x])^3*(c - I*c*Tan[e + f*x])^n,x]

[Out]

(I*a^3*E^(n*(-Log[c*Sec[e + f*x]] + Log[c - I*c*Tan[e + f*x]]))*Sec[e + f*x]^2*(c*Sec[e + f*x])^n*(2*(2 + n) +
 (4 + 3*n + n^2)*Cos[2*(e + f*x)] + I*n*(3 + n)*Sin[2*(e + f*x)]))/(f*n*(1 + n)*(2 + n))

________________________________________________________________________________________

Maple [A]
time = 1.29, size = 129, normalized size = 1.30

method result size
norman \(\frac {i a^{3} \left (n^{2}+5 n +8\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) \left (2+n \right ) f n}-\frac {i a^{3} \left (\tan ^{2}\left (f x +e \right )\right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{f \left (2+n \right )}-\frac {2 a^{3} \left (3+n \right ) \tan \left (f x +e \right ) {\mathrm e}^{n \ln \left (c -i c \tan \left (f x +e \right )\right )}}{\left (1+n \right ) f \left (2+n \right )}\) \(129\)
risch \(\text {Expression too large to display}\) \(1052\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+I*a*tan(f*x+e))^3*(c-I*c*tan(f*x+e))^n,x,method=_RETURNVERBOSE)

[Out]

I*a^3*(n^2+5*n+8)/(1+n)/(2+n)/f/n*exp(n*ln(c-I*c*tan(f*x+e)))-I/f/(2+n)*a^3*tan(f*x+e)^2*exp(n*ln(c-I*c*tan(f*
x+e)))-2*a^3*(3+n)/(1+n)/f/(2+n)*tan(f*x+e)*exp(n*ln(c-I*c*tan(f*x+e)))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 576 vs. \(2 (90) = 180\).
time = 0.57, size = 576, normalized size = 5.82 \begin {gather*} \frac {2^{n + 3} a^{3} c^{n} \cos \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) - i \cdot 2^{n + 3} a^{3} c^{n} \sin \left (n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right )\right ) + 8 \, {\left (a^{3} c^{n} n + 2 \, a^{3} c^{n}\right )} 2^{n} \cos \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + 4 \, {\left (a^{3} c^{n} n^{2} + 3 \, a^{3} c^{n} n + 2 \, a^{3} c^{n}\right )} 2^{n} \cos \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right ) + 8 \, {\left (-i \, a^{3} c^{n} n - 2 i \, a^{3} c^{n}\right )} 2^{n} \sin \left (-2 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 2 \, e\right ) + 4 \, {\left (-i \, a^{3} c^{n} n^{2} - 3 i \, a^{3} c^{n} n - 2 i \, a^{3} c^{n}\right )} 2^{n} \sin \left (-4 \, f x + n \arctan \left (\sin \left (2 \, f x + 2 \, e\right ), \cos \left (2 \, f x + 2 \, e\right ) + 1\right ) - 4 \, e\right )}{{\left ({\left (-i \, n^{3} - 3 i \, n^{2} - 2 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \cos \left (4 \, f x + 4 \, e\right ) + {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n} \sin \left (4 \, f x + 4 \, e\right ) + {\left (-i \, n^{3} - 3 i \, n^{2} - 2 \, {\left (i \, n^{3} + 3 i \, n^{2} + 2 i \, n\right )} \cos \left (2 \, f x + 2 \, e\right ) + 2 \, {\left (n^{3} + 3 \, n^{2} + 2 \, n\right )} \sin \left (2 \, f x + 2 \, e\right ) - 2 i \, n\right )} {\left (\cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (2 \, f x + 2 \, e\right )^{2} + 2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )}^{\frac {1}{2} \, n}\right )} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(c-I*c*tan(f*x+e))^n,x, algorithm="maxima")

[Out]

(2^(n + 3)*a^3*c^n*cos(n*arctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) - I*2^(n + 3)*a^3*c^n*sin(n*arctan2(
sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1)) + 8*(a^3*c^n*n + 2*a^3*c^n)*2^n*cos(-2*f*x + n*arctan2(sin(2*f*x + 2*
e), cos(2*f*x + 2*e) + 1) - 2*e) + 4*(a^3*c^n*n^2 + 3*a^3*c^n*n + 2*a^3*c^n)*2^n*cos(-4*f*x + n*arctan2(sin(2*
f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e) + 8*(-I*a^3*c^n*n - 2*I*a^3*c^n)*2^n*sin(-2*f*x + n*arctan2(sin(2*f*x
 + 2*e), cos(2*f*x + 2*e) + 1) - 2*e) + 4*(-I*a^3*c^n*n^2 - 3*I*a^3*c^n*n - 2*I*a^3*c^n)*2^n*sin(-4*f*x + n*ar
ctan2(sin(2*f*x + 2*e), cos(2*f*x + 2*e) + 1) - 4*e))/(((-I*n^3 - 3*I*n^2 - 2*I*n)*(cos(2*f*x + 2*e)^2 + sin(2
*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*cos(4*f*x + 4*e) + (n^3 + 3*n^2 + 2*n)*(cos(2*f*x + 2*e)^2 + s
in(2*f*x + 2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n)*sin(4*f*x + 4*e) + (-I*n^3 - 3*I*n^2 - 2*(I*n^3 + 3*I*n^2
+ 2*I*n)*cos(2*f*x + 2*e) + 2*(n^3 + 3*n^2 + 2*n)*sin(2*f*x + 2*e) - 2*I*n)*(cos(2*f*x + 2*e)^2 + sin(2*f*x +
2*e)^2 + 2*cos(2*f*x + 2*e) + 1)^(1/2*n))*f)

________________________________________________________________________________________

Fricas [A]
time = 1.15, size = 155, normalized size = 1.57 \begin {gather*} -\frac {4 \, {\left (-2 i \, a^{3} + {\left (-i \, a^{3} n^{2} - 3 i \, a^{3} n - 2 i \, a^{3}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (-i \, a^{3} n - 2 i \, a^{3}\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \left (\frac {2 \, c}{e^{\left (2 i \, f x + 2 i \, e\right )} + 1}\right )^{n}}{f n^{3} + 3 \, f n^{2} + 2 \, f n + {\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, {\left (f n^{3} + 3 \, f n^{2} + 2 \, f n\right )} e^{\left (2 i \, f x + 2 i \, e\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(c-I*c*tan(f*x+e))^n,x, algorithm="fricas")

[Out]

-4*(-2*I*a^3 + (-I*a^3*n^2 - 3*I*a^3*n - 2*I*a^3)*e^(4*I*f*x + 4*I*e) + 2*(-I*a^3*n - 2*I*a^3)*e^(2*I*f*x + 2*
I*e))*(2*c/(e^(2*I*f*x + 2*I*e) + 1))^n/(f*n^3 + 3*f*n^2 + 2*f*n + (f*n^3 + 3*f*n^2 + 2*f*n)*e^(4*I*f*x + 4*I*
e) + 2*(f*n^3 + 3*f*n^2 + 2*f*n)*e^(2*I*f*x + 2*I*e))

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 979 vs. \(2 (80) = 160\).
time = 0.99, size = 979, normalized size = 9.89 \begin {gather*} \begin {cases} x \left (i a \tan {\left (e \right )} + a\right )^{3} \left (- i c \tan {\left (e \right )} + c\right )^{n} & \text {for}\: f = 0 \\\frac {2 a^{3} f x \tan ^{2}{\left (e + f x \right )}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} + \frac {4 i a^{3} f x \tan {\left (e + f x \right )}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} - \frac {2 a^{3} f x}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} + \frac {i a^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} - \frac {2 a^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} - \frac {i a^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} - \frac {8 a^{3} \tan {\left (e + f x \right )}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} - \frac {4 i a^{3}}{2 c^{2} f \tan ^{2}{\left (e + f x \right )} + 4 i c^{2} f \tan {\left (e + f x \right )} - 2 c^{2} f} & \text {for}\: n = -2 \\- \frac {4 a^{3} f x \tan {\left (e + f x \right )}}{c f \tan {\left (e + f x \right )} + i c f} - \frac {4 i a^{3} f x}{c f \tan {\left (e + f x \right )} + i c f} - \frac {2 i a^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan {\left (e + f x \right )}}{c f \tan {\left (e + f x \right )} + i c f} + \frac {2 a^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{c f \tan {\left (e + f x \right )} + i c f} + \frac {a^{3} \tan ^{2}{\left (e + f x \right )}}{c f \tan {\left (e + f x \right )} + i c f} + \frac {5 a^{3}}{c f \tan {\left (e + f x \right )} + i c f} & \text {for}\: n = -1 \\4 a^{3} x + \frac {2 i a^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} - \frac {i a^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {3 a^{3} \tan {\left (e + f x \right )}}{f} & \text {for}\: n = 0 \\- \frac {i a^{3} n^{2} \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan ^{2}{\left (e + f x \right )}}{f n^{3} + 3 f n^{2} + 2 f n} - \frac {2 a^{3} n^{2} \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{f n^{3} + 3 f n^{2} + 2 f n} + \frac {i a^{3} n^{2} \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{3} + 3 f n^{2} + 2 f n} - \frac {i a^{3} n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan ^{2}{\left (e + f x \right )}}{f n^{3} + 3 f n^{2} + 2 f n} - \frac {6 a^{3} n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n} \tan {\left (e + f x \right )}}{f n^{3} + 3 f n^{2} + 2 f n} + \frac {5 i a^{3} n \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{3} + 3 f n^{2} + 2 f n} + \frac {8 i a^{3} \left (- i c \tan {\left (e + f x \right )} + c\right )^{n}}{f n^{3} + 3 f n^{2} + 2 f n} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))**3*(c-I*c*tan(f*x+e))**n,x)

[Out]

Piecewise((x*(I*a*tan(e) + a)**3*(-I*c*tan(e) + c)**n, Eq(f, 0)), (2*a**3*f*x*tan(e + f*x)**2/(2*c**2*f*tan(e
+ f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + 4*I*a**3*f*x*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c*
*2*f*tan(e + f*x) - 2*c**2*f) - 2*a**3*f*x/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) + I
*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f)
 - 2*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f
) - I*a**3*log(tan(e + f*x)**2 + 1)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 8*a**3*t
an(e + f*x)/(2*c**2*f*tan(e + f*x)**2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f) - 4*I*a**3/(2*c**2*f*tan(e + f*x)*
*2 + 4*I*c**2*f*tan(e + f*x) - 2*c**2*f), Eq(n, -2)), (-4*a**3*f*x*tan(e + f*x)/(c*f*tan(e + f*x) + I*c*f) - 4
*I*a**3*f*x/(c*f*tan(e + f*x) + I*c*f) - 2*I*a**3*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(c*f*tan(e + f*x) + I*
c*f) + 2*a**3*log(tan(e + f*x)**2 + 1)/(c*f*tan(e + f*x) + I*c*f) + a**3*tan(e + f*x)**2/(c*f*tan(e + f*x) + I
*c*f) + 5*a**3/(c*f*tan(e + f*x) + I*c*f), Eq(n, -1)), (4*a**3*x + 2*I*a**3*log(tan(e + f*x)**2 + 1)/f - I*a**
3*tan(e + f*x)**2/(2*f) - 3*a**3*tan(e + f*x)/f, Eq(n, 0)), (-I*a**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f
*x)**2/(f*n**3 + 3*f*n**2 + 2*f*n) - 2*a**3*n**2*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n**3 + 3*f*n**2 +
2*f*n) + I*a**3*n**2*(-I*c*tan(e + f*x) + c)**n/(f*n**3 + 3*f*n**2 + 2*f*n) - I*a**3*n*(-I*c*tan(e + f*x) + c)
**n*tan(e + f*x)**2/(f*n**3 + 3*f*n**2 + 2*f*n) - 6*a**3*n*(-I*c*tan(e + f*x) + c)**n*tan(e + f*x)/(f*n**3 + 3
*f*n**2 + 2*f*n) + 5*I*a**3*n*(-I*c*tan(e + f*x) + c)**n/(f*n**3 + 3*f*n**2 + 2*f*n) + 8*I*a**3*(-I*c*tan(e +
f*x) + c)**n/(f*n**3 + 3*f*n**2 + 2*f*n), True))

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+I*a*tan(f*x+e))^3*(c-I*c*tan(f*x+e))^n,x, algorithm="giac")

[Out]

integrate((I*a*tan(f*x + e) + a)^3*(-I*c*tan(f*x + e) + c)^n, x)

________________________________________________________________________________________

Mupad [B]
time = 1.68, size = 230, normalized size = 2.32 \begin {gather*} \frac {2\,a^3\,{\left (\frac {c\,\left (\cos \left (2\,e+2\,f\,x\right )+1-\sin \left (2\,e+2\,f\,x\right )\,1{}\mathrm {i}\right )}{\cos \left (2\,e+2\,f\,x\right )+1}\right )}^n\,\left (n\,7{}\mathrm {i}+\cos \left (2\,e+2\,f\,x\right )\,16{}\mathrm {i}+\cos \left (4\,e+4\,f\,x\right )\,4{}\mathrm {i}-2\,n^2\,\sin \left (2\,e+2\,f\,x\right )-n^2\,\sin \left (4\,e+4\,f\,x\right )+n\,\cos \left (2\,e+2\,f\,x\right )\,10{}\mathrm {i}+n\,\cos \left (4\,e+4\,f\,x\right )\,3{}\mathrm {i}-6\,n\,\sin \left (2\,e+2\,f\,x\right )-3\,n\,\sin \left (4\,e+4\,f\,x\right )+n^2\,1{}\mathrm {i}+n^2\,\cos \left (2\,e+2\,f\,x\right )\,2{}\mathrm {i}+n^2\,\cos \left (4\,e+4\,f\,x\right )\,1{}\mathrm {i}+12{}\mathrm {i}\right )}{f\,n\,\left (4\,\cos \left (2\,e+2\,f\,x\right )+\cos \left (4\,e+4\,f\,x\right )+3\right )\,\left (n^2+3\,n+2\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*tan(e + f*x)*1i)^3*(c - c*tan(e + f*x)*1i)^n,x)

[Out]

(2*a^3*((c*(cos(2*e + 2*f*x) - sin(2*e + 2*f*x)*1i + 1))/(cos(2*e + 2*f*x) + 1))^n*(n*7i + cos(2*e + 2*f*x)*16
i + cos(4*e + 4*f*x)*4i - 2*n^2*sin(2*e + 2*f*x) - n^2*sin(4*e + 4*f*x) + n*cos(2*e + 2*f*x)*10i + n*cos(4*e +
 4*f*x)*3i - 6*n*sin(2*e + 2*f*x) - 3*n*sin(4*e + 4*f*x) + n^2*1i + n^2*cos(2*e + 2*f*x)*2i + n^2*cos(4*e + 4*
f*x)*1i + 12i))/(f*n*(4*cos(2*e + 2*f*x) + cos(4*e + 4*f*x) + 3)*(3*n + n^2 + 2))

________________________________________________________________________________________